﻿using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Ports;
using System.Threading;
using System.ComponentModel;
namespace OtherDevice
{
    public enum DeviceType
    {
        气缸,
        串口,
        TcpIp,
    }
    public class ComParamter
    {
        [Category("串口参数"), DisplayName("端口号"), Description("串口参数,COM端口号")]
        public string str_CommPort { set; get; } = "COM0";//端口
        [Category("串口参数"), DisplayName("波特率"), Description("串口参数,波特率")]
        public int str_BaudRate { set; get; } = 9600; //波特率
        [Category("串口参数"), DisplayName("数据位"), Description("串口参数,数据位")]
        public int str_DataBit { set; get; } = 0;
        [Category("串口参数"), DisplayName("停止位"), Description("串口参数,停止位")]
        public StopBits str_StopBit { set; get; } = StopBits.One;
        [Category("串口参数"), DisplayName("校验码"), Description("串口参数,校验码")]
        public Parity str_Parity { set; get; } = Parity.None;
    }
    public class ClylinderParamter
    {
        [Category("气缸参数"), DisplayName("前段输出信号"), Description("气缸参数,前段输出信号")]
        public string str_前段输出信号 { set; get; }//端口
        [Category("气缸参数"), DisplayName("后段输出信号"), Description("气缸参数,后段输出信号")]
        public string str_后段输出信号 { set; get; } //波特率
        [Category("气缸参数"), DisplayName("前段感应到位信号"), Description("气缸参数,前段感应到位信号")]
        public string str_前段感应到位信号 { set; get; }
        [Category("气缸参数"), DisplayName("后段感应到位信号"), Description("气缸参数,后段感应到位信号")]
        public string str_后段感应到位信号 { set; get; }
        [Category("气缸参数"), DisplayName("是否为双控电磁阀"), Description("气缸参数,是否为双控电磁阀")]
        public bool b_是否为双控电磁阀 { set; get; }
        [Category("气缸参数"), DisplayName("双控输出信号时间间隔"), Description("气缸参数,双控输出信号时间间隔")]
        public int n_双控输出信号时间间隔 { set; get; }
        [Category("气缸参数"), DisplayName("检测到位延时"), Description("气缸参数,检测到位延时")]
        public int n_检测到位延时 { set; get; }
        [Category("气缸参数"), DisplayName("机器人名称"), Description("气缸参数,机器人名称")]
        public string str_机器人名称 { set; get; }
        [Category("气缸参数"), DisplayName("是否为机器人气缸"), Description("气缸参数,是否为机器人气缸")]
        public bool b_是否为机器人气缸 { set; get; }
    }
    public class TcpIpParamter
    {
        [Category("TcpIp"), DisplayName("序号"), Description("TcpIp,序号")]
        public int n_Index { set; get; } = 0;
        [Category("TcpIp"), DisplayName("名称"), Description("TcpIp,名称")]
        public string str_Name { set; get; } = "TCPIP";

        [Category("TcpIp"), DisplayName("IP地址"), Description("TcpIp,IP地址")]
        public string str_IP地址 { set; get; } = "127.0.0.10";
        [Category("TcpIp"), DisplayName("Port"), Description("TcpIp,Port")]
        public int n_Port { set; get; } = 504;
        [Category("TcpIp"), DisplayName("发送结束符"), Description("TcpIp,发送结束符")]
        public string str_发送结束符 { set; get; } = "CR";

        [Category("TcpIp"), DisplayName("接收结束符"), Description("TcpIp,接收结束符")]
        public string str_接收结束符 { set; get; } = "CR";
    }



}